package com.example.mykotlinapp

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.LinearLayout
import org.jetbrains.anko.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val layout = verticalLayout {
            val name = editText()
            val tag = textView()
            val layoutParams:LinearLayout.LayoutParams = tag.layoutParams as LinearLayout.LayoutParams
            layoutParams.topMargin = 30
            tag.text = "this is tag textView"
            button("Btn") {
                setOnClickListener {
                    toast("Your name is ${name.text}")
                }
            }
        }
        setContentView(layout)
    }

}
